<%--
  ** Copyright(c) 2005 BroadVision, Inc. All rights reserved.
  **
  ** This software is copyrighted.  Under the copyright laws, this software
  ** may not be copied, in whole or in part, without prior written consent
  ** of BroadVision, Inc. or its assignees. This software is provided under
  ** the terms of a license between BroadVision and the recipient, and its
  ** use is subject to the terms of that license.
  **
  ** This software may be protected by one or more U.S. and International
  ** patents. Certain applications of BroadVision One-To-One software are
  ** covered by U.S. patent 5,710,887.
  **
  ** TRADEMARKS: BroadVision and the BroadVision logo are registered
  ** trademarks, and BroadVision One-To-One is a trademark of BroadVision,
  ** Inc. IONA and Orbix are trademarks of IONA Technologies, Ltd. RSA,
  ** MD5, and RC2 are trademarks of RSA Data Security, Inc. All other
  ** trademarks, service marks, and trade names belong to their respective
  ** owners. BroadVision, Inc. disclaims any proprietary interest in the
  ** marks and names of others.
  --%>

<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %>
<%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean-el" %>

<%@ page import="com.broadvision.report.admin.LoggerConfig" %>

<%
  final LoggerConfig model =
          (LoggerConfig)request.getAttribute("loggerConfigModel");
  pageContext.setAttribute("logger", model);
%>

<c:set var="form" value="${reportLoggerForm.map}"/>

<script language="Javascript">
  function doLoggerDelete(form)
  {
    var msg = '<bean-el:message key="bp.report.logger.confirm.delete" bundle="bp.messages"/>';

    if (!confirm(msg))
      return false;

    form.action = '<c:url value="/bp/reportLoggerDelete.do"/>';
    form.submit();
    return true;
  }
  function doLoggerEdit(form)
  {
    form.action = '<c:url value="/bp/reportLoggerEdit.do"/>';
    form.submit();
    return true;

  }
</script>

<table class="zoneFive" summary="logger config"
       width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top" width="100%">
      <div class="pageTitle">
        <bean-el:message
          key="bp.report.loggerView.title"
          bundle="bp.messages"
          arg0="<%=model.getName()%>"
        />
      </div>
      <div class="errorMessage">
          <html-el:errors bundle="bp.messages" />
      </div>

      <html-el:form action="/bp/reportLoggerEdit.do">
        <html-el:hidden name ="reportLoggerForm" property="name"/>

        <div class="pageSubtitle">
          <span class="left">
            <bean-el:message
              key="bp.report.loggerView.${form.type}.subtitle"
              bundle="bp.messages"
            />
          </span>
          <span class="right">
            <c:set var="editButtonValue">
              <bean-el:message key="button.edit" bundle="bp.messages"/>
            </c:set>
            <c:set var="deleteButtonValue">
              <bean-el:message key="button.delete" bundle="bp.messages"/>
            </c:set>
            <input class="inputButton" type="SUBMIT" name="editBtn"
                   value="<c:out value="${editButtonValue}"/>"
                   onclick="return doLoggerEdit(this.form);">
            <input class="inputButton" type="SUBMIT" name="deleteBtn"
                   value="<c:out value="${deleteButtonValue}"/>"
                   onclick="return doLoggerDelete(this.form);">
          </span>
        </div>
      </html-el:form>

      <!--start main content area here-->
      <table class="labelForm"
             width="100%" border="0" cellspacing="0" cellpadding="0"
             summary="logger config info">
        <c:choose>
          <c:when test="${form.type == 'jdbc'}">
            <!-- JDBC logger -->
            <tr>
              <td valign="middle" width="16%" class="label">
                <bean-el:message
                  key="bp.report.loggerView.jdbc.label.resource"
                  bundle="bp.messages"
                />:
              </td>
              <td valign="top" width="34%" class="labelField">
                <c:out value="${logger.jdbc}"/>
              </td>
              <td valign="middle" width="16%" class="label">
                <bean-el:message
                  key="bp.report.loggerView.jdbc.label.table"
                  bundle="bp.messages"
                />:
              </td>
              <td valign="top" width="34%" class="labelField">
                <c:out value="${logger.table}"/>
              </td>
            </tr>
          </c:when>

          <c:when test="${form.type == 'file'}">
            <!-- file logger -->
            <tr>
              <td valign="middle" width="16%" class="label">
                <bean-el:message
                  key="bp.report.loggerView.file.label.path"
                  bundle="bp.messages"
                />:
              </td>
              <td valign="top" width="44%" class="labelField">
                <c:out value="${logger.path}"/>
              </td>
              <td valign="middle" width="16%" class="label">
                <bean-el:message
                  key="bp.report.loggerView.file.label.schedule"
                  bundle="bp.messages"
                />:
              </td>
              <td valign="top" width="24%" class="labelField">
                <c:out value="${logger.schedule}"/>
              </td>
            </tr>
          </c:when>
        </c:choose>
      </table>
    </td>
  </tr>
</table>

<!-- =============================================================
  ** vim: set ts=2 expandtab syntax=jsp:
  -->
